package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author 张永远
 * @since 2020-06-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_order_output")
public class OrderOutputDo extends Model<OrderOutputDo> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 1 一件代发 2 fba转运
     */
    @TableField("order_type")
    private Integer orderType;

    @TableField("platform")
    private String platform;

    @TableField("platform_number")
    private String platformNumber;
    /**
     * 0 未发货  1 已发货 2 待发货
     */
    @TableField("status")
    private Long status;


    @TableField("label_file_id")
    private Long labelFileId;

    /**
     * 截单之前状态
     */
    @TableField("cut_status")
    private Long cutStatus;

    @TableField("pick_up_id")
    private Long pickUpId;

    @TableField("send_date")
    private Date sendDate;

    @TableField("shop_id")
    private Long shopId;

    @TableField("diff_price")
    private double diffPrice;

    @TableField("storage_id")
    private Long storageId;

    /**
     * 出库单号  OT+yyyymmddhhmmss+id
     */
    @TableField("order_output_number")
    private String orderOutputNumber;

    @TableField("company_id")
    private Long companyId;

    /**
     * 顾客自定单号
     */
    @TableField("order_no")
    private String orderNo;

    @TableField("receiver_name")
    private String receiverName;

    @TableField("tel_phone")
    private String telPhone;

    @TableField("post_code")
    private String postCode;

    @TableField("area_id")
    private Long areaId;

    @TableField("area")
    private String area;

    @TableField("address")
    private String address;

    @TableField("cargo_owner")
    private String cargoOwner;

    @TableField("cargo_address")
    private String cargoAddress;

    @TableField("cargo_code")
    private String cargoCode;

    @TableField("cargo_phone")
    private String cargoPhone;

    @TableField("dangerous_good")
    private Integer dangerousGood;

    @TableField("problem_reason")
    private String problemReason;

    @TableField("tips")
    private String tips;

    @TableField("ship_fee")
    private double shipFee;

    @TableField("origin_ship_fee")
    private double originShipFee;

    @TableField("out_fee")
    private double outFee;

    @TableField("operate_fee")
    private double operateFee;

    @TableField("tax_fee")
    private double taxFee;

    @TableField("cut_fee")
    private double cutFee;

    @TableField("storage_sku")
    private String storageSku;

    @Getter
    @TableField("commodity_sku")
    private String commoditySku;

    @TableField(updateStrategy = FieldStrategy.IGNORED, value = "delivery_date")
    private Date deliveryDate;

    @TableField(updateStrategy = FieldStrategy.IGNORED, value = "delivery_time")
    private String deliveryTime;

    @TableField("shipment_type")
    private Integer shipmentType;

    @TableField("track_id")
    private Long trackId;

    @TableField("track_number")
    private String trackNumber;
    @TableField("upload_time")
    private Date uploadTime;
    @TableField("send_time")
    private Date sendTime;
    @TableField("arrive_time")
    private Date arriveTime;

    /**
     * 代收款
     */
    @TableField("cod")
    private Integer cod;

    /**
     * 文件
     */
    @TableField("file_id")
    private Long fileId;

    @TableField("po_number")
    private String poNumber;

    @TableField("fba_storage_id")
    private Long fbaStorageId;

    @TableField("appointment_storage_time")
    private Date appointmentStorageTime;

    @TableField("appointment_car_time")
    private Date appointmentCarTime;

    @TableField("create_time")
    private Date createTime;

    @TableField("create_by")
    private Long createBy;

    @TableField("update_time")
    private Date updateTime;

    @TableField("update_by")
    private Long updateBy;

    @TableField("delete_by")
    private Long deleteBy;

    @TableField("delete_time")
    private Date deleteTime;

    /**
     * 逻辑删除
     */
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;


    public OrderOutputDo() {
    }

    public OrderOutputDo(Integer orderType, Long status, Date sendDate, Long shopId, Long storageId, Long companyId, String orderNo, String receiverName, String telPhone, String postCode, String area, String address, Date deliveryDate, String deliveryTime) {
        this.orderType = orderType;
        this.status = status;
        this.sendDate = sendDate;
        this.shopId = shopId;
        this.storageId = storageId;
        this.companyId = companyId;
        this.orderNo = orderNo;
        this.receiverName = receiverName;
        this.telPhone = telPhone;
        this.postCode = postCode;
        this.area = area;
        this.address = address;
        this.deliveryDate = deliveryDate;
        this.deliveryTime = deliveryTime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
